package com.atguigu.springcloud.controller;


import com.atguigu.springcloud.entity.CommonResult;
import com.atguigu.springcloud.entity.Payment;
import com.atguigu.springcloud.service.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;
import java.util.concurrent.TimeUnit;

@RestController
@Slf4j
public class ConsumerController {

    @Autowired
    private PaymentService paymentService;

    @GetMapping(value = "/consumer/getPaymentById/{id}")
    public CommonResult getPaymentById(@PathVariable long  id){
        return paymentService.getPaymentById(id);
    }

    @GetMapping(value = "/consumer/payment/getTimeout")
    public String getTimeout(){
       return paymentService.getTimeout();
    }
}
